package com.example.demo.repository;

import com.example.demo.domain.Article;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * 帮助文章Repository
 * @Author zhengmf
 * @Date 2019/1/4  15:27
 */
@Repository
public interface ArticleRepository extends JpaRepository<Article,Long> {
    @Modifying
    @Query(value = "UPDATE SM_ARTICLE_TBL SET STATUS = :status WHERE ARTICLE_ID = :id",nativeQuery =true)
    void updateStatus(@Param(value = "status") String status, @Param(value = "id") Long id);
}
